Skip to content

ci: OIDC cannot do the first publish — keep a token for it - #6

Merged
catomean merged 1 commit into
mainfrom
ci/first-publish-needs-token
Aug 16, 2026
Merged

ci: OIDC cannot do the first publish — keep a token for it#6
catomean merged 1 commit into
mainfrom
ci/first-publish-needs-token

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

Same fix as ai-forms#15, applied here before hitting the same failure.

#3 moved publishing to OIDC trusted publishing with no token. That is the right destination, but trusted publishing is configured per package on npmjs.com, and a package that has never been published cannot have a trusted publisher configured. So OIDC alone cannot perform a first release.

Confirmed empirically on ai-forms tag v0.1.1:

npm notice publish Signed provenance statement with source and build information from GitHub Actions
npm error code E404
npm error 404 Not Found - PUT https://registry.npmjs.org/ai-forms
npm error 404  The requested resource 'ai-forms@0.1.1' could not be found or you do not have permission to access it.

Provenance signing works; the publish was simply unauthenticated, and npm answers 404 rather than 401 for that case on a non-existent package.

Restores NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} while keeping id-token: write. After the first release, configure a trusted publisher and delete the secret — npm prefers OIDC once one exists.

🤖 Generated with Claude Code

Same fix as ai-forms, before hitting the same failure. Trusted publishing
is configured per package on npmjs.com and cannot be configured for a
package that has never been published, so the token-free workflow fails
on the first release with E404 on the PUT.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@catomean
catomean merged commit af08370 into main Aug 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant